package com.zhuss.controller.order;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import com.zhuss.bean.bo.order.order.CreateOrderBo;
import com.zhuss.bean.bo.order.order.DeleteOrderBo;
import com.zhuss.bean.bo.order.order.UpdateOrderBo;
import com.zhuss.common.BaseController;
import com.zhuss.common.OperateService;
import com.zhuss.order.order.OrderOperateServiceExt;
import com.zhuss.exception.OceanException;


/**
 * @description: 订单操作的Controller
 * @author: zhushanshuo
 * @create: Wed Mar 24 22:32:50 CST 2021
 **/
@RestController
@RequestMapping("/order")
public class OrderOperateController extends BaseController {
	
	@Autowired
	@Qualifier("orderOperateService")
	private OperateService<Void, Object> orderOperateService;
	
	@Autowired
	@Qualifier("orderOperateServiceExt")
	private OrderOperateServiceExt orderOperateServiceExt;
	
	/**
	 * 创建
	 * @param bo
	 * @throws OceanException
	 */
	@ResponseBody
    @PostMapping("/create")
    public void create(@RequestBody CreateOrderBo bo) throws OceanException {
		
		orderOperateService.create(bo);
    }
	
	
	/**
	 * 修改
	 * @param bo
	 * @throws OceanException
	 */
	@ResponseBody
    @PostMapping("/update")
    public void update(@RequestBody UpdateOrderBo bo) throws OceanException {
		
		orderOperateService.update(bo);
    }
	
	/**
	 * 删除
	 * @param bo
	 * @throws OceanException
	 */
	@ResponseBody
    @PostMapping("/delete")
    public void delete(@RequestBody DeleteOrderBo bo) throws OceanException {
		
		orderOperateService.delete(bo);
    }
	
}
